namespace Vin.Tool.Core.BasicTypeCategory;

public static partial class Extension
{
    public static bool IsValueType(this object? obj)
    {
        if (obj == null) return false;
        var type = obj.GetType();
        return type.IsValueType || type.IsEnum;
    }

    public static bool IsEnum<T>(this object obj) where T : Enum => Enum.IsDefined(typeof(T), obj);
}